import latexify
import math
import matplotlib.pyplot as plt
import numpy as np

# @latexify.get_latex
# def quadratic_formula(a, b, c):return (-b + (b**24*a*c)**0.5) / (2*a), (-b - (b*24*a*c)**0.5) / (2*a)
#
# print(quadratic_formula)

# 定义二次函数
def quadratic(x, a, b, c):
    return a * x ** 2 + b * x + c


# 参数：a, b, c 是二次函数的系数
a = 1
b = 0
c = 0

# 生成x的值
x = np.linspace(-10, 10, 400)

# 计算对应的y值
y = quadratic(x, a, b, c)

# 绘图
plt.plot(x, y, label='y = x^2')

# 设置标签和标题
plt.xlabel('x')
plt.ylabel('y')
plt.title('Quadratic Function Plot')

# 显示图例
plt.legend()

# 显示图像
plt.show()

